#include<iostream>
#include<cstring>
using namespace std;

class robot
{
private:
    char *name;
    int hp,df,lv,ce;
    char type;
public:
    robot(){};
    robot(char *_name,char _type,int _lv):type(_type),lv(_lv)
    {
        name=new char[strlen(_name)+1];
		strcpy(name,_name);
        if(type=='N')
        {
            hp=5*lv;
            df=5*lv;
            ce=5*lv;
        }
        if(type=='A')
        {
            hp=5*lv;
            df=5*lv;
            ce=10*lv;
        }
        if(type=='D')
        {
            hp=5*lv;
            df=10*lv;
            ce=5*lv;
        }
        if(type=='H')
        {
            hp=50*lv;
            df=5*lv;
            ce=5*lv;
        }
    }
    void print()
    {
		cout<<name<<"--"<<type<<"--"<<lv<<"--"<<hp<<"--"<<ce<<"--"<<df<<endl;	
	}
    ~robot()
    {
        if(name!=NULL)
        {    
            delete name;
        }
    }
    friend bool upgrade(robot *r1,char t);
};

bool upgrade(robot *r1,char t){
	if(r1->type==t)
		return 0;
	r1->type=t;
		if(t=='N'){
			r1->hp=5*r1->lv;
			r1->ce=5*r1->lv;
			r1->df=5*r1->lv;
			}
		if(t=='A'){
			r1->hp=5*r1->lv;
			r1->ce=10*r1->lv;
			r1->df=5*r1->lv;
			}
		if(t=='D'){
			r1->hp=5*r1->lv;
			r1->ce=5*r1->lv;
			r1->df=10*r1->lv;
			}
		if(t=='H'){
			r1->hp=50*r1->lv;
			r1->ce=5*r1->lv;
			r1->df=5*r1->lv;
			}
		return 1;
}

int main()
{
    char name[20],type;
    int lv;
    int num=0;
    int t;
    cin>>t;
    while(t--)
    {
        cin>>name>>type>>lv;
        robot p(name,type,lv);
        char up;
        cin>>up;
        num+=upgrade(&p,up);
        p.print();
    }
    cout<<"The number of robot transform is "<<num;
    return 0;
}